Map-02. geocode,-02 geocodeMap-02. GeoCoding/ReverseGeoCoding)
The previous section briefly introduces how to obtain user locations and use longitude and latitude to represent locations. This section describes geographical encoding.
First, we need to know what is geocode
Concept:
Geographic code: it refers to the process of establishing the spatial coordinate relationship between statistical data or address
. However, most of these services do not have a Python-specific library and are inconsistent with each other's JSON structure. As a geocoder, the disobedient python God made a special geocoding tool to unify the services of these different vendors.
Geocoding Tools Geocoder
First look at which company's GeoCode services it supports:
Installation
Pip Install Geocoder
Geo-coding
Import Geocoderg = Geocoder.google ("1403 Washington Ave, New Orleans, LA 7
, you can access it like using local resources. For example, when accessing the map service on the server, it is like storing map documents and data locally.
Releasing GIS resource as a service is the key for people to access it. Generally, resources are created through ArcGIS Desktop and published as services for the client.
The following table lists the services that can be published and the resources required for each service.
Service Type
Required GIS Resources
. JQuery introduces the Deferred object in version 1.5, and can use jQuery. Deferred to construct the result in the function that returns promise. The function that returns promise is used to execute an asynchronous operation and solve the latency after completion.
var geocode = function( address ) { var dfd = new $.Deferred(); GMaps.geocode({ address: address, callback: function( response, status ) { return dfd.resolve( response );
) (location. getLatitude * 1E6), (int) (location. getlong1_* 1E6); mMapController. setCenter (point );
In the same way, if you know the longitude and latitude of a city, you can set it as the current map center, which enables you to locate the city location. How can you get the longitude and latitude of a city?Baidu Map API provides MKSearch. geocode (String address, String city) is used to search for the location of the specific address of a city. If
region where the user is located // 3.1 create a region // CLRegion has two sub-classes: The door is used to specify the area // a Bluetooth range can be specified/a circular range can be specified // create the center point CLLocationCoordinate2D center = CLLocationCoordinate2DMake (40.058501, 116.304171 ); // c create a circular area, specify the longitude and latitude of the center, and the radius CLCircularRegion * circular = [[CLCircularRegion alloc] initWithCenter: center radius: 500 iden
functions that return promise. A function that returns promise is used to perform some kind of asynchronous operation and resolve the delay after completion.
var geocode = function (address) {
var DFD = new $. Deferred ();
Gmaps.geocode ({
address:address,
callback:function (response, status) {return
dfd.resolve (response); c6/>}
});
return Dfd.promise ();
};
var getroute = function (FROMLATLNG, tolatlng) {
var DFD = n
classifications, returns relevant POI point information Pois/round searches near a center point based on keywords and/or classifications, returns relevant POI point information pois/view based on keywords and/or classifications, Search in a rectangle to return the relevant POI point informationPOI Data processing interface [NEW]Pois/add_poi added POI data pois/get_poi get new POI dataMobile Location interface [NEW]Loc/get_location return to the current location based on other data such as base
request usually takes the following form:
http://maps.google.com/maps/api/service/output?parameters
WhereserviceIndicates the requested service,outputResponse format (usuallyjsonOrxml).
2. Address Resolution and Reverse Address Resolution
Address Resolution is the process of converting an address (such as "1600 amphitheatre Parkway, Mountain View, ca") to a geographical coordinate (such as latitude 37.423021 and longitude-122.083739, you can place tags or locate maps based on the converted coor
the following form: Http://maps.google.com/maps/api/service/output?parameters where service represents the specific service requested, output Represents the response format (typically JSON or XML).
2. Address resolution and anti-address resolution
Address resolution is the process of converting addresses (such as "Amphitheatre Parkway, Mountain View, CA") to geographic coordinates (such as latitude 37.423021 and longitude-122.083739), You can place markers or locate the map based on the coordi
of coarse grained software objects (or helper objects) that can be generated and executed on the server. In fact, these extensive objects are built into ArcGIS desktop applications based on the same ArcGIS Engine object, but they provide users with a simple access method to interact with them. Examples of such objects include map servers, geocode servers, and geographic data processing servers. Each type of these objects is displayed as a network ser
---restore content starts---extends:http://blog.csdn.net/h7870181/article/details/12505883Google Maps API Web ServiceWebsite address:Https://developers.google.com/maps/documentation/webservices/?hl=zh-cnis actually some interface for us to invoke, such as:1, according to the address to obtain latitude and longitudeHttp://maps.google.com/maps/api/geocode/json?address= Beijing language=zh-cnsensor=false2. Calculate route datahttp://maps.googleapis.com/m
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.